package com.cmwa.scbp.sys.msg.vo;

import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.type.Alias;

import com.cmwa.scbp.base.mvc.entity.BaseVo;
import com.cmwa.scbp.utils.cached.DictionaryCached;

@Alias("msgConfVo")
public class MsgConfVo extends BaseVo {
	private String id;
	private String title;
	private String msgCode;
	private String sortNo;
	private String remark;

	private String sendType;
	private String triggerDate;
	private String noticeTitleTemplate;
	private String noticeContentTemplate;
	private String emailTitleTemplate;
	private String emailContentTemplate;
	private String smsContentTemplate;
	private String weChatContentTemplate;

	private String runStatus;

	private String createDate;
	private String modifyDate;

	private List<MsgEmpConfVo> emps;
	private List<MsgEmpConfVo> empsC;
	private MsgPackVo packVo;

	private String sendTypeNotice;
	private String sendTypeEmail;
	private String sendTypeSms;
	private String sendTypeBacklog;
	private String sendTypeWeChat;

	private List<MsgPublicEmailVo> pubEmailsR;
	private List<MsgPublicEmailVo> pubEmailsC;

	private String backlogTitleTemplate;
	private String backlogContentTemplate;
	private String backlogMenu;
	private String backlogMenuName;
	private String backlogUrl;
	private String backlogPageUrl;
	private String backlogParameter;

	private String msgEmpConfRs;// 收件人ID
	private String backlogOrMonitors;// 待办或监控的数量
	private String backlogOrMonitorTime;// 待办或监控的刷新时间

	public MsgConfVo() {
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	public String getMsgCode() {
		return msgCode;
	}

	public void setMsgCode(String msgCode) {
		this.msgCode = msgCode;
	}

	public String getSortNo() {
		return sortNo;
	}

	public void setSortNo(String sortNo) {
		this.sortNo = sortNo;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getSendTypeNm() {
		if (StringUtils.isNotBlank(this.getSendType())) {
            return DictionaryCached.getInstance().getDictionaryName(
                    "MSG_SEND_TYPE",
                    "MSG_SEND_TYPE",
                    "MSG_SEND_TYPE",
                    this.getSendType());
        }
        return getSendType();
	}
	
	public String getSendType() {
		return sendType;
	}

	public void setSendType(String sendType) {
		this.sendType = sendType;
	}

	public String getTriggerDate() {
		return triggerDate;
	}

	public void setTriggerDate(String triggerDate) {
		this.triggerDate = triggerDate;
	}

	public String getNoticeTitleTemplate() {
		return noticeTitleTemplate;
	}

	public void setNoticeTitleTemplate(String noticeTitleTemplate) {
		this.noticeTitleTemplate = noticeTitleTemplate;
	}

	public String getNoticeContentTemplate() {
		return noticeContentTemplate;
	}

	public void setNoticeContentTemplate(String noticeContentTemplate) {
		this.noticeContentTemplate = noticeContentTemplate;
	}

	public String getWeChatContentTemplate() {
		return weChatContentTemplate;
	}

	public void setWeChatContentTemplate(String weChatContentTemplate) {
		this.weChatContentTemplate = weChatContentTemplate;
	}

	public String getSendTypeNotice() {
		return sendTypeNotice;
	}

	public void setSendTypeNotice(String sendTypeNotice) {
		this.sendTypeNotice = sendTypeNotice;
	}

	public String getSendTypeWeChat() {
		return sendTypeWeChat;
	}

	public void setSendTypeWeChat(String sendTypeWeChat) {
		this.sendTypeWeChat = sendTypeWeChat;
	}

	public String getEmailTitleTemplate() {
		return emailTitleTemplate;
	}

	public void setEmailTitleTemplate(String emailTitleTemplate) {
		this.emailTitleTemplate = emailTitleTemplate;
	}

	public String getEmailContentTemplate() {
		return emailContentTemplate;
	}

	public void setEmailContentTemplate(String emailContentTemplate) {
		this.emailContentTemplate = emailContentTemplate;
	}

	public String getSmsContentTemplate() {
		return smsContentTemplate;
	}

	public void setSmsContentTemplate(String smsContentTemplate) {
		this.smsContentTemplate = smsContentTemplate;
	}

	public String getRunStatusNm() {
		if (StringUtils.isNotBlank(this.getRunStatus())) {
            return DictionaryCached.getInstance().getDictionaryName(
                    "MSG_RUN_STATUS",
                    "MSG_RUN_STATUS",
                    "MSG_RUN_STATUS",
                    this.getRunStatus());
        }
        return getRunStatus();
	}
	
	public String getRunStatus() {
		return runStatus;
	}

	public void setRunStatus(String runStatus) {
		this.runStatus = runStatus;
	}
	public String getCreateDate() {
		return createDate;
	}

	public void setCreateDate(String createDate) {
		this.createDate = createDate;
	}

	public String getModifyId() {
		return modifyId;
	}

	public void setModifyId(String modifyId) {
		this.modifyId = modifyId;
	}

	public String getModifyDate() {
		return modifyDate;
	}

	public void setModifyDate(String modifyDate) {
		this.modifyDate = modifyDate;
	}

	public List<MsgEmpConfVo> getEmps() {
		return emps;
	}

	public void setEmps(List<MsgEmpConfVo> emps) {
		this.emps = emps;
	}

	public String getSendTypeEmail() {
		return sendTypeEmail;
	}

	public void setSendTypeEmail(String sendTypeEmail) {
		this.sendTypeEmail = sendTypeEmail;
	}

	public String getSendTypeSms() {
		return sendTypeSms;
	}

	public void setSendTypeSms(String sendTypeSms) {
		this.sendTypeSms = sendTypeSms;
	}

	public MsgPackVo getPackVo() {
		return packVo;
	}

	public void setPackVo(MsgPackVo packVo) {
		this.packVo = packVo;
	}

	public List<MsgEmpConfVo> getEmpsC() {
		return empsC;
	}

	public void setEmpsC(List<MsgEmpConfVo> empsC) {
		this.empsC = empsC;
	}

	public List<MsgPublicEmailVo> getPubEmailsR() {
		return pubEmailsR;
	}

	public void setPubEmailsR(List<MsgPublicEmailVo> pubEmailsR) {
		this.pubEmailsR = pubEmailsR;
	}

	public List<MsgPublicEmailVo> getPubEmailsC() {
		return pubEmailsC;
	}

	public void setPubEmailsC(List<MsgPublicEmailVo> pubEmailsC) {
		this.pubEmailsC = pubEmailsC;
	}

	public String getSendTypeBacklog() {
		return sendTypeBacklog;
	}

	public void setSendTypeBacklog(String sendTypeBacklog) {
		this.sendTypeBacklog = sendTypeBacklog;
	}

	public String getBacklogTitleTemplate() {
		return backlogTitleTemplate;
	}

	public void setBacklogTitleTemplate(String backlogTitleTemplate) {
		this.backlogTitleTemplate = backlogTitleTemplate;
	}

	public String getBacklogContentTemplate() {
		return backlogContentTemplate;
	}

	public void setBacklogContentTemplate(String backlogContentTemplate) {
		this.backlogContentTemplate = backlogContentTemplate;
	}

	public String getBacklogUrl() {
		return backlogUrl;
	}

	public void setBacklogUrl(String backlogUrl) {
		this.backlogUrl = backlogUrl;
	}

	public String getBacklogParameter() {
		return backlogParameter;
	}

	public void setBacklogParameter(String backlogParameter) {
		this.backlogParameter = backlogParameter;
	}

	public String getBacklogMenu() {
		return backlogMenu;
	}

	public void setBacklogMenu(String backlogMenu) {
		this.backlogMenu = backlogMenu;
	}

	public String getBacklogMenuName() {
		return backlogMenuName;
	}

	public void setBacklogMenuName(String backlogMenuName) {
		this.backlogMenuName = backlogMenuName;
	}

	public String getBacklogPageUrl() {
		return backlogPageUrl;
	}

	public void setBacklogPageUrl(String backlogPageUrl) {
		this.backlogPageUrl = backlogPageUrl;
	}

	public String getMsgEmpConfRs() {
		return msgEmpConfRs;
	}

	public void setMsgEmpConfRs(String msgEmpConfRs) {
		this.msgEmpConfRs = msgEmpConfRs;
	}

	public String getBacklogOrMonitors() {
		return backlogOrMonitors;
	}

	public void setBacklogOrMonitors(String backlogOrMonitors) {
		this.backlogOrMonitors = backlogOrMonitors;
	}

	public String getBacklogOrMonitorTime() {
		return backlogOrMonitorTime;
	}

	public void setBacklogOrMonitorTime(String backlogOrMonitorTime) {
		this.backlogOrMonitorTime = backlogOrMonitorTime;
	}

	public void sendTypeSplit() {
		if (sendType != null && !"".equalsIgnoreCase(sendType.trim())) {
			if (sendType.indexOf("Notice") > -1) {
				sendTypeNotice = "Notice";
			}
			if (sendType.indexOf("Email") > -1) {
				sendTypeEmail = "Email";
			}
			if (sendType.indexOf("Sms") > -1) {
				sendTypeSms = "Sms";
			}
			if (sendType.indexOf("Backlog") > -1) {
				sendTypeBacklog = "Backlog";
			}
			if (sendType.indexOf("WeChat") > -1) {
				sendTypeWeChat = "WeChat";
			}
		} else {
			sendTypeNotice = "";
			sendTypeEmail = "";
			sendTypeSms = "";
			sendTypeBacklog = "";
			sendTypeWeChat = "";
		}
	}

	public void sendTypeMerge() {
		String tmp = "";
		if (sendTypeNotice != null && "Notice".equalsIgnoreCase(sendTypeNotice.trim())) {
			tmp += "Notice,";
		}
		if (sendTypeEmail != null && "Email".equalsIgnoreCase(sendTypeEmail.trim())) {
			tmp += "Email,";
		}
		if (sendTypeSms != null && "Sms".equalsIgnoreCase(sendTypeSms.trim())) {
			tmp += "Sms,";
		}
		if (sendTypeBacklog != null && "Backlog".equalsIgnoreCase(sendTypeBacklog.trim())) {
			tmp += "Backlog,";
		}
		if (sendTypeWeChat != null && "WeChat".equalsIgnoreCase(sendTypeWeChat.trim())) {
			tmp += "WeChat,";
		}
		if (tmp.length() > 0) {
			sendType = tmp.substring(0, tmp.length() - 1);
		} else {
			sendTypeNotice = "";
		}
	}
}
